
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import ElementLocale from 'element-ui/lib/locale'

Vue.use(VueI18n)

const messages = {
    en: {
       menu:{
           home:'Home',
           product:'ProductManage',
           order:'orderManage'
       },
        ...enLocale
    },
    zh: {
        menu: {
           home:'首页',
           product: '产品',
           order:'订单管理'
        },
        ...zhLocale
    }
}

// Create VueI18n instance with options
const i18n = new VueI18n({
    locale: 'zh', // set locale
    messages, // set locale messages
})
ElementLocale.i18n((key, value) => i18n.t(key, value));

export default i18n;